package ARRAY_TrinhCongDoc01;


public class model {
	public int[] Tmax(int[] a1){
		int[] max = new int[a1.length];
		int b =0;
		for (int i = 0; i <a1.length;i++){
			if (a1[i]>5){
				max[b] = a1[i];
				b++;
			}
		}
		int[] amax;
		amax = new int[b];
		System.arraycopy(max, 0, amax, 0, b);
		return amax;
	}
	public int[] Tmin(int[] a1){
		int[] min = new int[a1.length];
		int b =0;
		for (int i = 0; i<a1.length;i++){
			if(a1[i]<=5){
				min[b] = a1[i];
				b++;
			}
		}
		int[] amin;
		amin = new int[b];
		System.arraycopy(min, 0, amin, 0, b);
		return amin;
	}
}
